<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewReservationTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputText value="#{bundle.ViewReservationLabel_id}"/>
                    <h:outputText value="#{reservationController.selected.id}" title="#{bundle.ViewReservationTitle_id}"/>
                    <h:outputText value="#{bundle.ViewReservationLabel_room}"/>
                    <h:outputText value="#{reservationController.selected.room}" title="#{bundle.ViewReservationTitle_room}"/>
                    <h:outputText value="#{bundle.ViewReservationLabel_client}"/>
                    <h:outputText value="#{reservationController.selected.user}" title="#{bundle.ViewReservationTitle_client}"/>
                    <h:outputText value="#{bundle.ViewReservationLabel_reservationBegin}"/>
                    <h:outputText value="#{reservationController.selected.reservationBegin}" title="#{bundle.ViewReservationTitle_reservationBegin}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:outputText>
                    <h:outputText value="#{bundle.ViewReservationLabel_reservationEnd}"/>
                    <h:outputText value="#{reservationController.selected.reservationEnd}" title="#{bundle.ViewReservationTitle_reservationEnd}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:outputText>
                    <h:outputText value="#{bundle.ViewReservationLabel_price}"/>
                    <h:outputText value="#{reservationController.selected.price}" title="#{bundle.ViewReservationTitle_price}"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{reservationController.destroyAndView}" value="#{bundle.ViewReservationDestroyLink}" rendered="#{userRights.client || userRights.moderator}"/>
                <br />
                <br />
                <h:commandLink action="#{reservationController.prepareEdit()}" value="#{bundle.ViewReservationEditLink}" rendered="#{userRights.client}"/>
                <br />
                <br />
                <h:commandLink action="#{reservationController.prepareList()}" value="#{bundle.ViewReservationShowAllLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
